package com.atguigu.b_object;

public class Demo {
    public static void main(String[] args) {
        Student student = new Student("迪丽热巴",18);
        Student student2 = new Student("迪丽热巴",18);

        //直接输出对象就等效于输出对象.toString()方法
        System.out.println("student.toString() = " + student.toString());

        System.out.println("student = " + student);


        Student student1 = new Student("古力娜扎",20);
        System.out.println("student1 = " + student1);

        System.out.println("----------------------------");

        System.out.println(student.equals(student2)); //stu 和 stu2 对象是否相等  -> false[没有重写前]
        //-> true [重写后]
    }
}
